package com.itbaima.csmall.stock.webapi.quartz.rabbit;

import com.itbaima.csmall.commons.pojo.stock.entity.Stock;
import com.itbaima.csmall.stock.webapi.quartz.config.RabbitMQConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * <p>RabbitMQConsumer</p>
 *
 * @author Chen
 * @since 2023/3/8 16:42:42
 */
@Component
@Slf4j
@RabbitListener(queues = RabbitMQConfig.STOCK_QUEUE)
public class RabbitMQConsumer {

    @RabbitHandler
    public void handler(Stock stock) {
        log.info("接收到消息：{}", stock);
    }

}
